package Server;

// A class to encapsulate book records
public class BookRec {
  private int bookID;
  private String author;
  private String title;
  private String category;
  private String price;  // think: why might a "float" or "double" be better here?
  private String avail;

  public BookRec(int nID, String nAuthor, String nTitle, String nCat,
                          String nPrice,  String nAvail) {
    bookID = nID;      author = nAuthor;   title = nTitle;
    category = nCat;   price = nPrice;     avail = nAvail;
  }

  int    getBookID()   { return bookID; }
  String getAuthor()   { return author; }
  String getTitle()    { return title; }
  String getCategory() { return category; }
  String getPrice()    { return price; }
  String getAvail()    { return avail; }

  //will need some set methods if records are to be editable.

  public String toString() {
    return String.format("%04d\t%s\t%s\t%s\t%s\t%s\n",
      bookID, author, title, category, price, avail);
  }
}


